package com.mxprojects.constructors
{
	import com.mxprojects.language.Language;
	
	public class PopupWindowNav
	{
		public function PopupWindowNav(popup:PopupWindow, currentLocation:String, navElements:Array, clickFunction:Function){
			//this will put a nav where the extra title info appears in the popup menu
			var gap:String = "   ";
			var navData:String = "";
			for(var i:int = 0; i < navElements.length; i++){
				var navItem:String = "<a href=\"event:"+navElements[i]+"\">" + Language.main(navElements[i]) + "</a>" + gap;
				if(currentLocation == navElements[i]){
					navItem = "<a href=\"event:"+navElements[i]+"\"><b>" + Language.main(navElements[i]) + "</b></a>" + gap;
				}
				
				//add the item to the string
				navData += navItem;
			}
			
			//put the nav in the title bar			
			popup.extraTitle(navData, clickFunction);
		}

	}
}